﻿using ComicQ.Domain.Table;
using FluentNHibernate.Mapping;

namespace ComicQ.Domain.Mapping
{
    sealed class MemberMap : ClassMap<Member>
    {
        public MemberMap()
        {
            Id(x => x.Id);
            Map(x => x.Username);
            Map(x => x.Password);
            Map(x => x.Name);
            Map(x => x.Address);
            Map(x => x.Phone);
            Map(x => x.Email);
            Map(x => x.JoinDate);
            HasMany(x => x.Orders).Cascade.All().Inverse();
            HasMany(x => x.Comments).Cascade.All().Inverse();
        }
    }
}
